<cfparam name = "Dir" default="/">
<cfparam name = "f" default="docs">
<cfparam name = "filen" default="">
<cfset newfilen = replacenocase(filen, ".cfm", "")>
<cfset newfilen = '#newfilen#_copy'>
<cfloop condition="fileexists('#request.adminpath##f##Dir##newfilen#.cfm')">
	<cfset newfilen = '#newfilen#_copy'>
</cfloop>

<cfif len(trim(filen)) GT 0>
<cffile action="copy" source="#request.adminpath##f##Dir##filen#" destination="#request.adminpath##f##Dir##newfilen#.cfm" mode="777">
</cfif>

<cflocation url="index.cfm?c=admindocs&f=#f#&dir=#dir#">